#ifndef MAIN_LIST_VIEW_H
#define MAIN_LIST_VIEW_H

class MainListView : public wxListView,public DirectoryWatcher,public FilePropertiesWatcher
{
public:
    MainListView(wxWindow *parent, unsigned int pId);
    ~MainListView();
	bool ChangePath(const wxString &path, bool useSelectioMap = false, bool forceRefresh = false);
	wxString GetCurrentPath();	
private:
	class FileDropTarget : public wxDropTarget
	{
	public:
		FileDropTarget(MainListView *view);
		virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
	private:
		MainListView *owner;
	};
    void OnContextMenu(wxContextMenuEvent& event);
    void OnListKeyDown(wxListEvent& event);
	void OnKeyDown(wxKeyEvent &event);
    void OnActivated(wxListEvent& event);
	void OnBeginDrag(wxListEvent& event);
    bool UpdateList(const wxString &path, bool forceRefresh = false);
	void ShowDriveSelection();
    virtual void DirectoryChanged(const wxString &path);
	MainListView *GetOtherMainListView();
	virtual void FilePropertyChanged(const wxString &fullPath, FileProperties &fileProperties);
    wxString currentPath;
    map<wxString, long> selectionMap;
	map<wxString, FileProperties> filePropertiesChanges;
	set<long> selection;
	wxColourDatabase colorDatabase;
	unsigned int id;
	bool itemDataNeedDeletion;
};
#endif